package com.xms.security.service.dataauth;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xms.security.entity.RoleObjectAccess;
import com.xms.security.identity.ICurrentUser;

import java.util.List;
import java.util.UUID;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author migo
 * @since 2021-09-04
 */
public interface IRoleObjectAccessService extends IService<RoleObjectAccess> {
    List<UUID> authorized(ICurrentUser currentUser, int objectTypeCode, List<UUID> objectId);

    boolean createMany(int objectTypeCode, UUID objectId, List<UUID> roleId);

    boolean deleteByObjectId(UUID objectId, int objectTypeCode);

    boolean deleteByObjectId(int objectTypeCode, List<UUID> objectId);

    boolean exists(UUID objectId, int objectTypeCode, List<UUID> roleId);

    boolean deleteByRole(UUID roleId, int objectTypeCode);

    List<RoleObjectAccess> getRolePermissions(UUID roleId, int objectTypeCode);

    List<RoleObjectAccess> getRolePermissions(int objectTypeCode, List<UUID> roleId);
}
